/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * CAlumnos.java
 *
 * Created on 12-ene-2012, 18:55:57
 */

package proyecto;
import java.sql.*;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableModel;

/**
 *
 * @author dell
 */
public class CAlumnos extends javax.swing.JFrame {
    private static Connection conexion;
    private static Statement st;
    private boolean append;

    /** Creates new form CAlumnos */
    public CAlumnos() {
        initComponents();
    }

    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                CAlumnos CAlum = new CAlumnos();
                CAlum.setVisible(true);

                CAlum.btnNuevo.setEnabled(false);
                CAlum.btnEditar.setEnabled(false);
                CAlum.btnGrabar.setEnabled(false);
                CAlum.btnBorrar.setEnabled(false);
                CAlum.btnCancelar.setEnabled(false);


                CAlum.desactiva();
            }
        });

        try {
            Class.forName("com.mysql.jdbc.Driver");
            conexion = DriverManager.getConnection("jdbc:mysql://localhost/bdatos?user=root&password=1234");
             st =  conexion.createStatement();

            /*String query1 = "INSERT INTO alumnos (Matricula_Alu,Nombre_Alu, ApPaterno_Alu,ApMaterno_Alu,Carrera_Alu,Email_Alu) " +
                    "VALUE (9160001,'Jorge','Garcia','Lizarraga','Ing. en Sistemas','its_jogali@hotmail.com')";
            st.executeUpdate(query1);
            */            

            String query2 = "SELECT * FROM alumnos";
            ResultSet rs = st.executeQuery(query2);
            while(rs.next()){
                System.out.println("id:"+rs.getInt("id_Alu") +
                        " Matricula:"+rs.getString("Matricula_Alu")+
                        "Nombre: "+rs.getString("Nombre_Alu")+
                        " Apellidos: "+rs.getString("ApPaterno_Alu")+rs.getString("ApMaterno_Alu")+
                        " Carrera: "+rs.getString("Carrera_Alu")+
                        " Email: "+rs.getString("Email_Alu"));
            }

            System.out.println("Fin del programa");

        } catch(Exception ex) {
            ex.printStackTrace();
            System.out.println("Ocurrio un error grave....jejeje");
        }
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        jInternalFrame1 = new javax.swing.JInternalFrame();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        txtMatricula = new javax.swing.JTextField();
        txtApPat = new javax.swing.JTextField();
        txtApMat = new javax.swing.JTextField();
        txtNombre = new javax.swing.JTextField();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        cmbCarrera = new javax.swing.JComboBox();
        txtEmail = new javax.swing.JTextField();
        jSeparator1 = new javax.swing.JSeparator();
        btnNuevo = new javax.swing.JButton();
        btnEditar = new javax.swing.JButton();
        btnGrabar = new javax.swing.JButton();
        btnCancelar = new javax.swing.JButton();
        btnSalir = new javax.swing.JButton();
        txtCarrera = new javax.swing.JTextField();
        jLabel8 = new javax.swing.JLabel();
        btnBorrar = new javax.swing.JButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTable1 = new javax.swing.JTable();
        lblError = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("ABC de Alumnos");
        setAlwaysOnTop(true);
        setBounds(new java.awt.Rectangle(0, 0, 0, 0));
        setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        setName("frmCAlumnos"); // NOI18N
        setResizable(false);
        setType(java.awt.Window.Type.UTILITY);
        getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jLabel1.setBackground(new java.awt.Color(255, 51, 0));
        jLabel1.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
        jLabel1.setForeground(new java.awt.Color(255, 51, 0));
        jLabel1.setText("Instituto Tecnológico Superior de Eldorado");
        getContentPane().add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 30, -1, -1));

        jInternalFrame1.setTitle("ABC de Alumnos");
        jInternalFrame1.setToolTipText("Mantenimiento a Alumnos");
        jInternalFrame1.setVisible(true);
        jInternalFrame1.getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jLabel2.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jLabel2.setText("Matricula");
        jInternalFrame1.getContentPane().add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 140, 64, -1));

        jLabel3.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jLabel3.setText("Nombre(s)");
        jLabel3.setHorizontalTextPosition(javax.swing.SwingConstants.LEFT);
        jInternalFrame1.getContentPane().add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 190, 90, -1));

        jLabel4.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jLabel4.setText("Ap. Paterno");
        jInternalFrame1.getContentPane().add(jLabel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(300, 160, -1, -1));

        jLabel5.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jLabel5.setText("Ap. Materno");
        jInternalFrame1.getContentPane().add(jLabel5, new org.netbeans.lib.awtextra.AbsoluteConstraints(490, 160, -1, -1));

        txtMatricula.setName(""); // NOI18N
        txtMatricula.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtMatriculaActionPerformed(evt);
            }
        });
        txtMatricula.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txtMatriculaKeyPressed(evt);
            }
        });
        jInternalFrame1.getContentPane().add(txtMatricula, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 130, 90, 30));

        txtApPat.setMaximumSize(new java.awt.Dimension(200, 20));
        txtApPat.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txtApPatKeyPressed(evt);
            }
        });
        jInternalFrame1.getContentPane().add(txtApPat, new org.netbeans.lib.awtextra.AbsoluteConstraints(260, 180, 176, 30));

        txtApMat.setMaximumSize(new java.awt.Dimension(200, 20));
        txtApMat.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txtApMatKeyPressed(evt);
            }
        });
        jInternalFrame1.getContentPane().add(txtApMat, new org.netbeans.lib.awtextra.AbsoluteConstraints(450, 180, 180, 30));

        txtNombre.setMaximumSize(new java.awt.Dimension(200, 20));
        txtNombre.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtNombreActionPerformed(evt);
            }
        });
        txtNombre.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txtNombreKeyPressed(evt);
            }
        });
        jInternalFrame1.getContentPane().add(txtNombre, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 180, 140, 30));

        jLabel6.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jLabel6.setText("Carrera");
        jInternalFrame1.getContentPane().add(jLabel6, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 240, -1, -1));

        jLabel7.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jLabel7.setText("E-Mail");
        jInternalFrame1.getContentPane().add(jLabel7, new org.netbeans.lib.awtextra.AbsoluteConstraints(300, 240, -1, -1));

        cmbCarrera.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Ing. Industrial", "Ing. en Sistemas Computacionales", "Ing. en Industrias Alimentarias", "Ing. en Gestión Empresarial" }));
        cmbCarrera.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cmbCarreraActionPerformed(evt);
            }
        });
        jInternalFrame1.getContentPane().add(cmbCarrera, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 70, -1, 27));

        txtEmail.setMaximumSize(new java.awt.Dimension(200, 20));
        txtEmail.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtEmailActionPerformed(evt);
            }
        });
        txtEmail.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txtEmailKeyPressed(evt);
            }
        });
        jInternalFrame1.getContentPane().add(txtEmail, new org.netbeans.lib.awtextra.AbsoluteConstraints(350, 230, 280, 30));
        jInternalFrame1.getContentPane().add(jSeparator1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 52, 6414, -1));

        btnNuevo.setText("Nuevo");
        btnNuevo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnNuevoActionPerformed(evt);
            }
        });
        jInternalFrame1.getContentPane().add(btnNuevo, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 11, -1, -1));

        btnEditar.setText("Editar");
        btnEditar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnEditarActionPerformed(evt);
            }
        });
        jInternalFrame1.getContentPane().add(btnEditar, new org.netbeans.lib.awtextra.AbsoluteConstraints(69, 11, -1, -1));

        btnGrabar.setText("Grabar");
        btnGrabar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnGrabarActionPerformed(evt);
            }
        });
        jInternalFrame1.getContentPane().add(btnGrabar, new org.netbeans.lib.awtextra.AbsoluteConstraints(136, 11, -1, -1));

        btnCancelar.setText("Cancelar");
        btnCancelar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCancelarActionPerformed(evt);
            }
        });
        jInternalFrame1.getContentPane().add(btnCancelar, new org.netbeans.lib.awtextra.AbsoluteConstraints(276, 11, -1, -1));

        btnSalir.setText("Salir");
        btnSalir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSalirActionPerformed(evt);
            }
        });
        jInternalFrame1.getContentPane().add(btnSalir, new org.netbeans.lib.awtextra.AbsoluteConstraints(357, 11, -1, -1));

        txtCarrera.setMaximumSize(new java.awt.Dimension(200, 20));
        txtCarrera.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtCarreraActionPerformed(evt);
            }
        });
        txtCarrera.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txtCarreraKeyPressed(evt);
            }
        });
        jInternalFrame1.getContentPane().add(txtCarrera, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 230, 180, 30));

        jLabel8.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jLabel8.setText("Carrera");
        jInternalFrame1.getContentPane().add(jLabel8, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 70, 64, -1));

        btnBorrar.setText("Borrar");
        jInternalFrame1.getContentPane().add(btnBorrar, new org.netbeans.lib.awtextra.AbsoluteConstraints(207, 11, -1, -1));

        jTable1.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        jScrollPane1.setViewportView(jTable1);

        jInternalFrame1.getContentPane().add(jScrollPane1, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 284, 630, 290));

        lblError.setText("jLabel9");
        jInternalFrame1.getContentPane().add(lblError, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 590, 610, -1));

        getContentPane().add(jInternalFrame1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 80, 660, 650));

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void cmbCarreraActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cmbCarreraActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_cmbCarreraActionPerformed

    private void btnSalirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSalirActionPerformed
        // TODO add your handling code here:
        // comando para salir del proyecto
        txtNombre.setText("jorge");
        cmbCarrera.setSelectedItem(1);
        txtCarrera.setText(cmbCarrera.getItemAt(1)+"");
        //String txtEmail = (cmbCarrera.getItemListeners());
        //Listener x = (cmbCarrera.getItemListeners());
        //txtEmail.setText( cmbCarrera.getItemCount()+"");
        System.exit(0);
        
    }//GEN-LAST:event_btnSalirActionPerformed

    private void btnNuevoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnNuevoActionPerformed
        // TODO add your handling code here:
        txtMatricula.setText("");
        txtApPat.setText("");
        txtApMat.setText("");
        txtNombre.setText("");
        txtEmail.setText("");
        
        btnNuevo.setEnabled(false);
        btnCancelar.setEnabled(true);
        
        txtMatricula.setText("");
    }//GEN-LAST:event_btnNuevoActionPerformed

    private void btnCancelarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCancelarActionPerformed
        // TODO add your handling code here:
        btnNuevo.setEnabled(false);
        btnCancelar.setEnabled(false);
        btnEditar.setEnabled(false);
        btnGrabar.setEnabled(false);
        btnBorrar.setEnabled(false);
        limpia();
        desactiva();
    }//GEN-LAST:event_btnCancelarActionPerformed

    private void txtNombreActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtNombreActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txtNombreActionPerformed

    private void txtEmailActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtEmailActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txtEmailActionPerformed

    private void txtCarreraActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtCarreraActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txtCarreraActionPerformed

    private void txtMatriculaKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtMatriculaKeyPressed
        // TODO add your handling code here:

        int key = evt.getKeyChar();

        if ( key==10){
            desactiva();
            try {
                String query = "SELECT * FROM alumnos where Matricula_Alu ='" + txtMatricula.getText()+"'";
                //Statement st =  conexion.createStatement();
                System.out.println(query);
                ResultSet rs = st.executeQuery(query);

                boolean encontro=false;

                while (rs.next()) {                    
                    String txt2 = rs.getString("Matricula_Alu");
                    System.out.println(txt2);

                    txtNombre.setText(rs.getString("Nombre_Alu"));
                    txtApPat.setText(rs.getString("ApPaterno_Alu"));
                    txtApMat.setText(rs.getString("ApMaterno_Alu"));
                    txtCarrera.setText(rs.getString("Carrera_Alu"));
                    txtEmail.setText(rs.getString("Email_Alu"));

                    btnNuevo.setEnabled(false);
                    btnCancelar.setEnabled(true);
                    btnEditar.setEnabled(true);
                    btnGrabar.setEnabled(false);
                    btnBorrar.setEnabled(true);
                    
                    encontro=true;
                    break;
                }

                if (!encontro){
                    btnNuevo.setEnabled(true);
                    btnCancelar.setEnabled(true);
                    activa();
                    limpia();
                }



                //txtApPat.requestFocus(true);
            } catch (SQLException ex) {
                Logger.getLogger(CAlumnos.class.getName()).log(Level.SEVERE, null, ex);
            }
        } else {
            try {

                lblError.setText("Hola");
                
                String queryp = "SELECT * FROM alumnos where Matricula_Alu LIKE '" + txtMatricula.getText()+"'";
                ResultSet rsp = st.executeQuery(queryp);

                String titulos[] = {"Matricula","Nombre","Paterno","Materno"};
                String datos[][] = new String[20][4];
                int row = 0;
        
                while (rsp.next()) {
                    //String txt2 = rs.getString("Matricula_Alu");
                    //System.out.println(txt2);

                    datos[row][0]=(rsp.getString("Nombre_Alu"));
                    datos[row][1]=(rsp.getString("ApPaterno_Alu"));
                    datos[row][2]=(rsp.getString("ApMaterno_Alu"));
                    datos[row][3]=(rsp.getString("Carrera_Alu"));
                //datos[row][4]=(rs.getString("Email_Alu"));

                    TableModel tm = new DefaultTableModel(datos, titulos);
                    jTable1.setModel(tm);
                    row+=1;

                }
            } catch(Exception ex){
            }
        }
    }//GEN-LAST:event_txtMatriculaKeyPressed

    public void desactiva() {
        txtNombre.setEditable(false);
        txtApPat.setEditable(false);
        txtApMat.setEditable(false);
        txtCarrera.setEditable(false);
        txtEmail.setEditable(false);
    }

    public void activa() {
        txtNombre.setEditable(true);
        txtApPat.setEditable(true);
        txtApMat.setEditable(true);
        txtCarrera.setEditable(true);
        txtEmail.setEditable(true);
    }

    public void limpia(){
        txtMatricula.setText("");
        txtNombre.setText("");
        txtApPat.setText("");
        txtApMat.setText("");
        txtCarrera.setText("");
        txtEmail.setText("");
    }

    public void Llena(int row, String dato1, String dato2, String dato3, String dato4) {
        String titulos[] = {"Matricula","Nombre","Paterno","Materno"};
        String datos[][] = new String[2][4];
        datos[0][0]="1";
        datos[0][1]="Jorge";
        datos[0][2]="Garcia";
        datos[0][3]="Lizarraga";
        datos[1][0]="2";
        datos[1][1]="Katherinne";
        datos[1][2]="Garcia";
        datos[1][3]="Barraza";

        TableModel tm = new DefaultTableModel(datos, titulos);
        jTable1.setModel(tm);
    }
    private void txtMatriculaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtMatriculaActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txtMatriculaActionPerformed

    private void txtApPatKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtApPatKeyPressed
        // TODO add your handling code here:
        int key = evt.getKeyCode();
        if ( key==10){

           txtApMat.requestFocus(true);
        }
    }//GEN-LAST:event_txtApPatKeyPressed

    private void txtApMatKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtApMatKeyPressed
        // TODO add your handling code here:
        int key = evt.getKeyCode();
        if ( key==10){

           txtNombre.requestFocus(true);
        }
    }//GEN-LAST:event_txtApMatKeyPressed

    private void txtNombreKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtNombreKeyPressed
        // TODO add your handling code here:
        int key = evt.getKeyCode();
        if ( key==10){

           txtCarrera.requestFocus(true);
        }
    }//GEN-LAST:event_txtNombreKeyPressed

    private void txtCarreraKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtCarreraKeyPressed
        // TODO add your handling code here:
        int key = evt.getKeyCode();
        if ( key==10){
            
           txtEmail.requestFocus(true);
        }
    }//GEN-LAST:event_txtCarreraKeyPressed

    private void txtEmailKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtEmailKeyPressed
        // TODO add your handling code here:
        int key = evt.getKeyCode();
        if ( key==10){

           //txtApPat.requestFocus(true);
        }
    }//GEN-LAST:event_txtEmailKeyPressed

    private void btnEditarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEditarActionPerformed
        // TODO add your handling code here:
        //txtNombre.setEditable(true);
        activa();
        
        btnEditar.setEnabled(false);
        btnBorrar.setEnabled(false);
        btnGrabar.setEnabled(true);
    }//GEN-LAST:event_btnEditarActionPerformed

    private void btnGrabarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnGrabarActionPerformed
        try {
            // TODO add your handling code here:
            String query = "UPDATE alumnos set Nombre_Alu=?, ApPaterno_Alu=?, ApMaterno_Alu=?, Carrera_Alu=?, Email_Alu=? where Matricula_Alu=?";
            // String Matricula=txtmatricula.getText();

            String Nombre = txtNombre.getText();
            String ApPat = txtApPat.getText();
            String ApMat = txtApMat.getText();
            String Carrera = txtCarrera.getText();
            String Email = txtEmail.getText();
            String Matricula = txtMatricula.getText();

            System.out.println(Nombre+"-"+ApPat+"-"+ApMat+"-"+Carrera+"-"+Email+"-"+Matricula);
            PreparedStatement ps = conexion.prepareStatement(query);
            
            ps.setString(1, Nombre);
            ps.setString(2, ApPat);
            ps.setString(3, ApMat);
            ps.setString(4, Carrera);
            ps.setString(5, Email);
            ps.setString(6, Matricula);
            
            ps.executeUpdate();
                     
            limpia();
            btnGrabar.setEnabled(false);
            btnCancelar.setEnabled(false);
            btnNuevo.setEnabled(true);

            //lblError = "Registro Actualizado"
        }
        /**
         * @param args the command line arguments
         */
        catch (SQLException ex) {
            Logger.getLogger(CAlumnos.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_btnGrabarActionPerformed

    /**
    * @param args the command line arguments
    */
    

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnBorrar;
    private javax.swing.JButton btnCancelar;
    private javax.swing.JButton btnEditar;
    private javax.swing.JButton btnGrabar;
    private javax.swing.JButton btnNuevo;
    private javax.swing.JButton btnSalir;
    private javax.swing.JComboBox cmbCarrera;
    private javax.swing.JInternalFrame jInternalFrame1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JTable jTable1;
    private javax.swing.JLabel lblError;
    private javax.swing.JTextField txtApMat;
    private javax.swing.JTextField txtApPat;
    private javax.swing.JTextField txtCarrera;
    private javax.swing.JTextField txtEmail;
    private javax.swing.JTextField txtMatricula;
    private javax.swing.JTextField txtNombre;
    // End of variables declaration//GEN-END:variables

}
